<template>
  <div class="view-editor">
    <tinymce :language="language" @input="handleInput"></tinymce>
  </div>
</template>

<script>
import Tinymce from '@/components/tinymce'
export default {
  components: { Tinymce },
  data() {
    return {
      languageList: Object.freeze({
        en: 'en',
        zh: 'zh_CN'
      })
    }
  },
  computed: {
    language() {
      const language = this.$store.getters.language
      return this.languageList[language]
    }
  },
  methods: {
    handleInput(val) {
      console.log(val)
    }
  }
}
</script>

<style lang="stylus">
.view-editor
  height 100%
</style>
